Skip to content

Incorporate meta-fields into ExecuteCollectedFields #1177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

benjie
Copy link
Member

@benjie benjie commented Jul 3, 2025

GraphQL.js uses a getFieldDef() helper:

https://github.com/graphql/graphql-js/blob/9032db1e4e55052bead6936359ecc5592c817f64/src/execution/execute.ts#L1047-L1079

called from executeField() to get the field definition to execute; returning meta-field definitions as appropriate.

This spec change reflects this existing behavior as best we can.

(Technically GraphQL.js' executeField() function overlaps responsibilities between the ExecuteField() and ExecuteCollectedFields() algorithms in the spec - specifically, executeField() may return undefined, resulting in executeFields() not adding the entry to the result object, whereas this conditional addition is handled in ExecuteCollectedFields() in the spec and we cannot/should not differentiate between null and undefined in this way.)

@benjie benjie added 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) 🚀 Next Stage? This RFC believes it is ready for the next stage labels Jul 3, 2025
Copy link

netlify bot commented Jul 3, 2025

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit 4b7c111
🔍 Latest deploy log https://app.netlify.com/projects/graphql-spec-draft/deploys/6867d29d68a7bb0008666675
😎 Deploy Preview https://deploy-preview-1177--graphql-spec-draft.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@leebyron leebyron added 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md) and removed 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) labels Jul 3, 2025
@benjie benjie force-pushed the meta-field-resolution branch from ef0449d to 3d6864e Compare July 4, 2025 13:01
@benjie
Copy link
Member Author

benjie commented Jul 4, 2025

@leebyron I think this matches what you had in mind? (Leaving the resolvers of the introspection system to be the behaviour of those defined within that section of the spec.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Next Stage? This RFC believes it is ready for the next stage 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants